<meta charset="UTF-8">
<div class="row">
  <div class="col-sm-2 col-md-2" th:if="${list.size() != 0}" th:each="c:${list}">
    <div class="thumbnail">
      <img data-th-src="'book/download?uuid='+${c.book.uuid}" alt="图片加载中！">
      <div class="caption">
      	<input type="hidden" th:value="${c.id}" id="recordid">
        <h3 th:text="${c.book.bookName}"></h3>
     	<h4>作者：<span th:text="${c.book.author}"></span></h4>
		<h4>出版社：<span th:text="${c.book.press}"></span></h4>
     	  简介：<p th:text="${c.book.intro}"></p>
        <p><a href="#" class="btn btn-primary" role="button" onclick="borrow()">还书</a></p>
      </div>
    </div>
  </div>
  <div th:if="${list.size() == 0}">
  	<h2>您还未借书</h2>
  </div>
</div>
<script>
function borrow(){
	var recordid = $('#recordid').val();
	$.post('borrowRecord/givebook',{recordid:recordid},function(result){
		if(result.success){
			bootbox.alert("还书成功！");
		}else{
			bootbox.alert("还书失败！");
		}
	})
}
</script>